/**
 * Main jquery loader, run when the page is loaded <br />
 * equivalent to &lt;body onload='doSomethint()'&gt;
 */
$(document)
		.ready(function() {
			/**
			 * Ajax loader config
			 */
			$("#loading").ajaxStart(function() {
				$(this).fadeIn();
			});

			$("#loading").ajaxStop(function() {
				$(this).fadeOut();
			});

			// set up the spring test to work with ajax
				$("#frmTestSpring")
						.submit(
								function() {
									var data = {};
									data.name = this.name.value;
									$
											.ajax( {
												url : "/ifdb/test.do",
												type : "GET",
												data : data,
												datatype : "text/json",
												success : function(country) {
													$("#returntest").fadeIn();
													$("#returntest")
															.html(
																	"Country:"
																			+ country.name
																			+ "<br />"
																			+ "Ctates: "
																			+ country.states[0].name
																			+ "<br />"
																			+ "Cities: "
																			+ country.states[0].cities[0].name);
												}
											});
									return false;
								});

			});